約 5,871,498 件
https://w.atwiki.jp/ntemacs/pages/20.html
【お知らせ】 2017/11/27 追記 本ページはメンテナンスされておりません。利用するツールにこだわりがなければ、「Windows の操作を Emacs のキーバインドで行うための設定 (Keyhac版)」をお薦めします。AutoHotKey の設定を必要としている場合は、次のページも併せて参照ください。 https //github.com/usi3/emacs.ahk https //qiita.com/crz/items/8d864eabfd3922c9a79c http //oneh.blog.jp/archives/9213862.html 【本題】 Windows の操作を Emacs のキーバインドで行うための設定(AutoHotKey版)です。 「Windows の操作を Emacs のキーバインドで行うための設定 (Keyhac版)」の方が多機能ですが、AutoHotKey でシンプルに実現したい場合には利用できると思います。 AutoHotKey のスクリプトは、コンパイルすることにより exe ファイルとして起動することもできます。 ;;; -*- coding utf-8-with-signature-dos -*- ;;; ;;; Windows の操作を Emacs のキーバインドで行うための設定(AutoHotKey版) ;;; ;; このスクリプトは、次のページを参考として作成したものです。 ;; http //usi3.com/emacs-like-keybindings-on-windows.html ;; このページの作者に感謝します。 ;; このスクリプトは、AutoHotkey_L (Unicode版)で動作確認しています。 ;; http //ahkwiki.net/Top ;; スクリプトですので、使いやすいようにカスタマイズしてご利用ください。 ;; スクリプトのまま使うこともできますが、AutoHotkey_L 付属の「Convert .ahk to .exe」 ;; を使うと、exe ファイルに変換することができます。exe ファイルに変換することで、 ;; AutoHotkey_L がインストールされていない PC でも Emacsキーバインドが利用可能 ;; となります。 ;; この内容は、utf-8-with-signature-dos の coding-system で ahk_emacs.ahk 等の名前で ;; セーブして利用してください。 ;; Emacs の挙動と明らかに違う動きの部分は以下のとおりです。 ;; ・ESC の二回押下で、ESC を入力できる。 ;; ・C-o と C-\ で IME の切り替えが行われる。 ;; ・C-k を連続して実行しても、クリップボードへの削除文字列の蓄積は行われない。 ;; ・C-c、C-z は、Windows の「コピー」、「取り消し」が機能するようにしている。 ;; ・C-x o は、一つ前にフォーカスがあったウインドウに移動する。 ;; NTEmacs から Windowsアプリケーションソフトを起動した際に戻るのに便利。 ;; ・プレキー(ESC、C-x)は、その後にそのプレキーが意味を持つ後続キーが入力され ;; なかった場合、状態が不定となる。(プレキーが有効となり続ける場合がある。) ;; (実装を簡素にするため。C-g を押せば、無効となる。) ;; ・C-l は、アプリケーションソフト個別対応とする。recenter 関数で個別に指定すること。 ;; この設定では、Sakura Editor のみ対応している。 ;; ・C-u には対応できていない。 ;; ・キーボードマクロには対応していない。 ;; ・Excel の場合、^Enter に F2(セル編集モード移行)を割り当てている。 #InstallKeybdHook #UseHook ;; Emacs のキーバインドに"したくない"アプリケーションソフトを指定する ;; ・リターンコードが 0 の場合: 全てのキーバインドを有効とする ;; ・リターンコードが 1 の場合: 全てのキーバインドを無効とする ;; ・リターンコードが 2 の場合: input method の切り替えのみを有効とする ;; キーバインドの指定は、477行目(^\)と 648行目(^o)の辺りで行っている ;; ahk_class は、AutoHotKey_L 付属の「AutoIt3 Windows Spy」で確認できる is_target() { global if (WinActive("ahk_class ConsoleWindowClass")) { ; Cmd, Cygwin return 2 } if (WinActive("ahk_class mintty")) { ; mintty return 2 } if (WinActive("ahk_class Emacs")) { ; NTEmacs return 1 } if (WinActive("ahk_class Vim")) { ; Vim return 2 } if (WinActive("ahk_class PuTTY")) { ; PuTTY return 2 } if (WinActive("ahk_class SWT_Window0")) { ; Eclipse return 2 } if (WinActive("xyzzy")) { ; xyzzy return 2 } if (is_c_q = 1) { is_c_q = 0 return 1 } else { return 0 } } ;; コマンドディレイを 0ms にする SetKeyDelay 0 ;; C-x が押されると1になる is_c_x = 0 ;; Escが押されると1になる is_esc = 0 ;; C-Space が押されると1になる is_spc = 0 ;; C-q が押されると1になる。 is_c_q = 0 ;; プレキーの確認 get_pre_key() { global if (is_c_x = 1) { is_c_x = 0 return 1 } if (is_esc = 1) { is_esc = 0 return 2 } return 0 } ;; IMEの切替え toggle_input_method() { Send {vkF3sc029} } ;; ファイル操作 find_file() { Send ^o global is_spc = 0 } save_buffer() { Send ^s } write_file() { Send !fa } ;; カーソル移動 forward_char() { global if (is_spc) { Send +{Right} } else { Send {Right} } } backward_char() { global if (is_spc) { Send +{Left} } else { Send {Left} } } next_line() { global if (is_spc) { Send +{Down} } else { Send {Down} } } previous_line() { global if (is_spc) { Send +{Up} } else { Send {Up} } } move_beginning_of_line() { global if (is_spc) { Send +{Home} } else { Send {Home} } } move_end_of_line() { global if (is_spc) { if (WinActive("ahk_class OpusApp")) { ; Microsoft Word Send +{End}+{Left} } else { Send +{End} } } else { Send {End} } } beginning_of_buffer() { global if (is_spc) { Send ^+{Home} } else { Send ^{Home} } } end_of_buffer() { global if (is_spc) { Send ^+{End} } else { Send ^{End} } } scroll_up() { global if (is_spc) { Send +{PgUp} } else { Send {PgUp} } } scroll_down() { global if (is_spc) { Send +{PgDn} } else { Send {PgDn} } } recenter() { if (WinActive("ahk_class TextEditorWindow")) { ; Sakura Editor Send ^h } } ;; カット / コピー / 削除 / アンドゥ delete_backward_char() { Send {BS} global is_spc = 0 } delete_char() { Send {Del} global is_spc = 0 } kill_line() { global is_spc = 1 move_end_of_line() Send ^c{Del} is_spc = 0 } kill_region() { Send ^x global is_spc = 0 } kill_ring_save() { Send ^c if (!WinActive("ahk_class XLMAIN")) { ; Microsoft Excel 以外 Send {Esc} } global is_spc = 0 } yank() { Send ^v global is_spc = 0 } undo() { Send ^z global is_spc = 0 } set_mark_command() { global if (is_spc) { is_spc = 0 } else { is_spc = 1 } } mark_whole_buffer() { Send ^{End}^+{Home} global is_spc = 1 } mark_page() { Send ^{End}^+{Home} global is_spc = 1 } open_line() { Send {Enter}{Up}{End} global is_spc = 0 } ;; バッファ / ウインドウ操作 kill_buffer() { Send ^{F4} global is_spc = 0 } other_window() { SetKeyDelay 10 Send !{Tab} SetKeyDelay 0 global is_spc = 0 } ;; 文字列検索 / 置換 isearch_forward() { Send ^f global is_spc = 0 } isearch_backward() { Send ^f global is_spc = 0 } ;; その他 newline() { Send {Enter} global is_spc = 0 } newline_and_indent() { Send {Enter}{Tab} global is_spc = 0 } indent_for_tab_command() { Send {Tab} global is_spc = 0 } quote_insert() { global is_c_q = 1 } keybord_quit() { if (!WinActive("ahk_class XLMAIN")) { ; Microsoft Excel 以外 Send {Esc} } global is_spc = 0 global is_c_x = 0 global is_esc = 0 } kill_emacs() { Send !{F4} global is_spc = 0 } ;; キーバインド Esc if (is_target()) { Send {%A_ThisHotkey%} } else { if (get_pre_key() = 2) { Send {%A_ThisHotkey%} is_esc = 0 } else { is_esc = 1 } } return ^Space if (is_target()) { Send {CtrlDown}{Space}{CtrlUp} } else { set_mark_command() } return ^/ if (is_target()) { Send %A_ThisHotkey% } else { undo() } return if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 2) { beginning_of_buffer() } else { Send %A_ThisHotkey% } } return ! if (is_target()) { Send %A_ThisHotkey% } else { beginning_of_buffer() } return if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 2) { end_of_buffer() } else { Send %A_ThisHotkey% } } return ! if (is_target()) { Send %A_ThisHotkey% } else { end_of_buffer() } return ^@ if (is_target()) { Send %A_ThisHotkey% } else { set_mark_command() } return ^[ if (is_target()) { Send {%A_ThisHotkey%} } else { if (get_pre_key() = 2) { Send {Esc} is_esc = 0 } else { is_esc = 1 } } return ^\ if (is_target() = 1) { Send %A_ThisHotkey% } else { toggle_input_method() } return ^_ if (is_target()) { Send %A_ThisHotkey% } else { undo() } return ^a if (is_target()) { Send %A_ThisHotkey% } else { move_beginning_of_line() } return ^b if (is_target()) { Send %A_ThisHotkey% } else { backward_char() } return ^c if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { kill_emacs() } else { ; kill_ring_save() Send %A_ThisHotkey% is_spc = 0 } } return ^d if (is_target()) { Send %A_ThisHotkey% } else { delete_char() } return ^e if (is_target()) { Send %A_ThisHotkey% } else { move_end_of_line() } return ^f if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { find_file() } else { forward_char() } } return ^g if (is_target()) { Send %A_ThisHotkey% } else { keybord_quit() } return h if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { mark_whole_buffer() } else { Send %A_ThisHotkey% } } return ^h if (is_target()) { Send %A_ThisHotkey% } else { delete_backward_char() } return ^i if (is_target()) { Send %A_ThisHotkey% } else { indent_for_tab_command() } return ^j if (is_target()) { Send %A_ThisHotkey% } else { newline_and_indent() } return k if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { kill_buffer() } else { Send %A_ThisHotkey% } } return ^k if (is_target()) { Send %A_ThisHotkey% } else { kill_line() } return ^l if (is_target()) { Send %A_ThisHotkey% } else { recenter() } return ^m if (is_target()) { Send %A_ThisHotkey% } else { newline() } return ^n if (is_target()) { Send %A_ThisHotkey% } else { next_line() } return o if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { other_window() } else { Send %A_ThisHotkey% } } return ^o if (is_target() = 1) { Send %A_ThisHotkey% } else { ; open_line() toggle_input_method() } return ^p if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { mark_page() } else { previous_line() } } return ^q if (is_target()) { Send %A_ThisHotkey% } else { quote_insert() } return ^r if (is_target()) { Send %A_ThisHotkey% } else { isearch_backward() } return ^s if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { save_buffer() } else { isearch_forward() } } return u if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { undo() } else { Send %A_ThisHotkey% } } return v if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 2) { scroll_up() } else { Send %A_ThisHotkey% } } return ^v if (is_target()) { Send %A_ThisHotkey% } else { scroll_down() } return !v if (is_target()) { Send %A_ThisHotkey% } else { scroll_up() } return w if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 2) { kill_ring_save() } else { Send %A_ThisHotkey% } } return ^w if (is_target()) { Send %A_ThisHotkey% } else { if (get_pre_key() = 1) { write_file() } else { kill_region() } } return !w if (is_target()) { Send %A_ThisHotkey% } else { kill_ring_save() } return ^x if (is_target()) { Send %A_ThisHotkey% } else { is_c_x = 1 } return ^y if (is_target()) { Send %A_ThisHotkey% } else { yank() } return ^z if (is_target()) { Send %A_ThisHotkey% } else { undo() } return ;; for Excel ^Enter if (is_target()) { Send {CtrlDown}{Enter}{CtrlUp} } else { if (WinActive("ahk_class XLMAIN")) { ; Microsoft Excel Send {F2} } else { Send {CtrlDown}{Enter}{CtrlUp} } } return 変更履歴 2012/09/15 C-q(quote-insert)をサポートした。 2012/09/16 C-z(undo)をサポートした。 2012/09/17 キーボードの取りこぼしをコマンドディレイを 0ms にすることで対応した。 2012/09/20 is_target() 関数のリータンの返し方に不具合があったのを修正した。 2012/10/01 other_windows() が正しく動かなかったので、KeyDelay を入れた。 2012/11/01 C-q の対応コマンドを quote_insert として動作するようにした。 2012/11/02 C-o をIMEの切替の設定とした。 2013/06/27 IfWinActive、IfNotWinActiveによる判定を、ifとWinActive関数で置き換えた。 2013/07/28 無効とするアプリケーションソフトに xyzzy を追加した。 2013/07/28 input method の切り替えだけができる設定の仕組みを追加した。 2013/08/19 Sakura Editor のみ C-l に対応した。
https://w.atwiki.jp/kandoushita/pages/46.html
WinRoll NY #160;Wheel WipeOut ぴたすちお Trayzer pinz Plancoin CloseAppQ(CloseAppに含まれるCloseAppQ.exe) ResizeEnable Pinz GoneIn60s ここを編集 名前 [部分編集] 93 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2009/10/08(木) 21 50 15 ID 3dMpxEjW0 WinRoll 【機能】タイトルバーを残してウィンドウを閉じる 【リンク】 ttp //www.forest.impress.co.jp/lib/dktp/desktop/windowextn/winroll.html 【コメント】 最小化しなくて良いから便利 昔MAC使ってた人にはいいかも +... ▼ 96 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2009/10/08(木) 22 37 44 ID 4KuX0H9C0 >>93 マウ筋でやってる 551 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2009/07/28(火) 01 52 46 ID DVxLV5160 NY Wheel 【機能】非アクティブなウィンドウでもホイールスクロールを可能にする常駐ソフト 【リンク】http //park1.wakwak.com/~y-nagano/Programs/nywheel/ 【コメント】似たようなソフトはいくらでもあるけど、余計な設定が何もなく空気のように使えて、 なおかつ64bit版Windowsでちゃんと動くのが嬉しい。 +... ▼ 552 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2009/07/28(火) 10 54 10 ID nFPlvO120 >>551 >>81 81 名無しさん@お腹いっぱい。 [sage] 2009/06/04(木) 17 39 59 ID AwO28O0t0 -New それTTBaseでできるよ ▼ 566 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2009/07/28(火) 23 29 54 ID DVxLV5160 >>552 TTBaseにRedirectWheelプラグインを入れて使ってたんだけど、 なんかたまにうまく動かない時があって。 で、検索していろいろ試した挙句にNY Wheelを見つけて感動したの。 調子悪いのはウチだけなのかな、Vistaだからかな? [部分編集] 243 名無しさん@お腹いっぱい。 [sage] 2009/06/11(木) 08 24 54 ID gFRpx8Do0 WipeOut 【機 能 】ウィンドウに隠れたアイコンを覗き見る 【 リンク 】http //www.forest.impress.co.jp/lib/dktp/desktop/windowextn/wipeout.html 【コメント】寿司屋の暖簾を潜った感覚におちいる [部分編集] 85 名無しさん@お腹いっぱい。 [sage] 2007/12/15(土) 17 16 35 ID W9jn0MT50 ぴたすちお 【機能】 Windowsにおけるマウスを使ったウィンドウ操作などを便利にするためのソフトウェア 【リンク】 http //ara.moo.jp/ 【コメント】 ウィンドウスナップとファイル名編集の拡張機能が特に便利 +... ▼ 86 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2007/12/15(土) 17 52 59 ID IHIysbqh0 85 これはいい ▼ 89 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2007/12/15(土) 19 44 38 ID wpnTgyya0 85 便利だわ ▼ 105 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2007/12/25(火) 07 22 32 ID M7XD1KmZ0 85 いい [部分編集] 264 名無しさん@お腹いっぱい。 [sage] 2008/03/28(金) 22 07 53 ID un7bi5t/0 Trayzer 【.. 機能...】 アプリケーションウィンドウをワンタッチでタスクトレイに格納できるソフト 【 リンク .】 http //softmania.seesaa.net/ 【コメント.】 使ってみりゃ良いじゃん [部分編集] 157 名無しさん@お腹いっぱい。 [sage] 2008/10/07(火) 23 17 40 ID iS5lVZKk0 pinz 【機能】任意のwindowを最前面にする 【リンク】http //www.vector.co.jp/soft/win95/util/se343088.html 【コメント】 ドラッグで出来る。ちょー楽 [部分編集] 666 名無しさん@お腹いっぱい。 [sage] 2009/01/26(月) 23 25 05 ID RqGLjCKt0 Plancoin 【機能】 ボスが来た 【リンク】 http //www.forest.impress.co.jp/article/2007/02/13/plancoin.html 【コメント】 指定したキーワードが含まれるウィンドウだけを隠せる「ボスが来た」的なソフト。 例えばゲーム画面だけを隠して、カモフラージュ用のOfficeソフトだけを残す、なんてことも可能。 隠すと同時に音を消せる。英語だけど設定項目が少ないので迷うことなく使えるはず。 [部分編集] 795 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2009/02/01(日) 02 02 54 ID jqkxISwJ0 CloseAppQ(CloseAppに含まれるCloseAppQ.exe) 【機能】Ctrl+Qでアクティブウィンドウを閉じる 【リンク】http //www.d9.dion.ne.jp/~nejimaki/arch/prod/products.htm#CloseApp 【コメント】 Ctrl+Wで閉じられないソフトに使う Alt+F4より押しやすい +... ▼ 800 名前:名無しさん@お腹いっぱい。[sage] 投稿日:2009/02/01(日) 15 36 14 ID BBRJJmlT0 >>795 面白いソフトだね [部分編集] 779 名無しさん@お腹いっぱい。 [sage] 2009/03/18(水) 05 36 42 ID oxOZKaEc0 ResizeEnable 【機能】サイズ固定ウィンドウをリサイズ可能に 【リンク】http //www.forest.impress.co.jp/article/2007/11/28/okiniiri.html 【コメント】XPで画面のDPIを標準よりおっきくしてると 設定ダイアログなどが途中で切れちゃうソフト続出、俺も切れちゃう これがないと本気困る [部分編集] 366 名無しさん@お腹いっぱい。 [sage] 2009/04/28(火) 08 22 17 ID yxlCLmCm0 Pinz 【機能】 ... ウィンドウ最前面化 【リンク】... http //tidbits.sakura.ne.jp/trac/ 【コメント】 任意のウィンドウを最全面固定にできる 狭い画面にウィンドウ重ねててこれだけは前面に、というときに重宝。 シンプル。マウス派向け。 同サイトのninjaっていうランチャーもイイ。 [部分編集] 369 名無しさん@お腹いっぱい。 [sage] 2009/04/28(火) 12 00 47 ID TQAreTKJ0 GoneIn60s 【機能】 60秒以内に閉じたウィンドウを復元 【リンク】 ttp //www.donationcoder.com/Software/Skrommel/GoneIn60s/GoneIn60s.exe 【コメント】 誤ってエクスプローラを閉じたときなんかに重宝する
https://w.atwiki.jp/hid_ahk/pages/14.html
テンキーをF13~F24にする テンキーをF13~F24にする注意点(重要) (1)ChangeKey をインストールする (2)ChangeKeyでテンキー(Numpad系)をF13~F24にする (3)「HID Macros と Autohotkey を連携させるの手順(1)から(7-2)」を行う。 (4)Saiがアクティブ時、且つUSBテンキー①ならキーカスタマイズ、それ以外なら通常のテンキーにするサンプル 注意点(重要) 以下を実行するとキーボードのテンキーもF13~F24に変更されます。これはあくまでペイントツールSAIがAutohotkeyよりもLowレベル(OSに近いところ)でキー情報を取得してしまい、ビュー系ショートカット(Shift+テンキー)が誤発動してしまうのを回避するために行う処置です。 SAIのビュー系ショートカットが誤発動する原因。Autohotkeyを使ってテンキーにShiftを割り当てると、SAIがAutohotkeyよりもLowレベル(OSに近いところ)でテンキーとして認識してしまい、Autohotkeyで割り当てたShiftとSAI側で認識しているテンキーの両方が押されたこととなり、SAIのビュー系ショートカット(Shift+テンキー)が誤発動します。これを回避するため、テンキーの基本割り当てをF13~F24へ変更し、SAIがShift+F13(~F24)と認識しても、このショートカットに何も割り当てられていないため何も起こらないということです。 SAIのような特殊なものを除き、一般的なアプリケーションソフト(PhotoshopやIllustrator等)はAutohotkeyよりもLowレベルでキー情報を取得することはありませんので、USBデバイス(USBキーボード、USBテンキー、USBコントローラー等)ごとの独立したキー割り当てはHID Macros と Autohotkey を連携させるの設定だけで大丈夫です。 (1)ChangeKey をインストールする ChangeKeyをインストールする。 (2)ChangeKeyでテンキー(Numpad系)をF13~F24にする ChangeKeyを実行する。 ChangeKeyのウィンドウが開いたら、テンキーの「1」キーを選択(クリック)。 「【1 】キーをどのキーに変更しますか?」というウィンドウが表示されるので右上の「Scan Code」をクリック。 スキャンコードを直接入力するウィンドウが表示されるので「0064」(0x0064はF13のスキャンコード)を入力して「OK」。 テンキーの「2」キーを選択(クリック)。 「【2 】キーをどのキーに変更しますか?」というウィンドウが表示されるので右上の「Scan Code」をクリック。 スキャンコードを直接入力するウィンドウが表示されるので「0065」(0x0065はF14のスキャンコード)を入力して「OK」。 以下、下記表を参考にテンキーの3、4、6~9、0、ドット(.)、+、ー にF15~F24を割り当てる。 割り当てが完了したら「登録」→「現在の設定内容で登録します」を選択し、Windowsを再起動する。 USBテンキーのキー ChangeKeyで割り当てるキー スキャンコード 1 F13 F13 = 0x0064 2 F14 F14 = 0x0065 3 F15 F15 = 0x0066 4 F16 F16 = 0x0067 5 変更しない 6 F17 F17 = 0x0068 7 F18 F18 = 0x0069 8 F19 F19 = 0x006a 9 F20 F20 = 0x006b 0 F21 F21 = 0x006c .(ドット) F22 F22 = 0x006d Tab 変更しない / * BackSpace - F23 F23 = 0x006e + F24 F24 = 0x0076 Enter 変更しない (3)「HID Macros と Autohotkey を連携させるの手順(1)から(7-2)」を行う。 「HID Macros と Autohotkey を連携させるの手順(1)から(7-2)」を実施する。 (4)Saiがアクティブ時、且つUSBテンキー①ならキーカスタマイズ、それ以外なら通常のテンキーにするサンプル USBテンキーを複数接続(①と②)している環境でSaiがアクティブなときだけキーカスタマイズし、その条件以外は通常のテンキー入力がされるサンプルです。 +←サンプルを表示する #SingleInstance, Force #Persistent OnMessage(99999, "HidMacros") Menu, Tray, Add , GetScript return ; Autoexecセクション はここまで GetScript ; スクリプトをクリップボードにコピーする DetectHiddenWindows, On SetTitleMatchMode,RegEx Hwnd = WinExist(".*\\ahk_hidmacros.ahk\s-\sAutoHotkey.* ahk_class AutoHotkey") WinGetTitle, WinTitle, ahk_id %Hwnd% Clipboard = hWnd = FindWindow ( "AutoHotkey", `"%WinTitle%`" ) Clipboard = %Clipboard%`nIf hWnd then`n Call PostMessage(hWnd, 99999, 1, 1 ) Clipboard = %Clipboard%`nEnd If msgbox, %Clipboard%`nをクリップボードにコピーしました。 DetectHiddenWindows, Off return ; HidMacros( [wParam, lParam, msg, hwnd] ) 引数は省略可 HidMacros(wParam, lParam) { ; 第三と第四引数は必要ないので省く。 If ( wParam = 1 ) { ; USBテンキー① なら IfWinActive, ahk_class sfl_window_class ; Saiがアクティブなら { If ( lParam = 1 ) { ; F13(テンキー1) なら send, {space down} ; spaceを押し下げる ※Saiなら手のひらツール keywait, F13 ; F13(テンキーの1)を開放するまで待つ send, {space up} ; spaceを放す } Else If ( lParam = 2 ) { ; F14(テンキー2) なら send, {alt down} ; Altを押し下げる ※Saiならスポイト keywait, F14 ; F14(テンキー2)を開放するまで待つ send, {alt up} ; Altを放す } Else If ( lParam = 3 ) { ; F15(テンキー3) なら send, {alt down}{space down} ; AltとSpaceを押し下げる ※Saiならビュー回転 keywait, F15 ; F15(テンキー3)を開放するまで待つ send, {space Up}{alt up} ; AltとSpaceを放す } Else { ; 他のキーは通常のテンキーにする Gosub, TenkeyMode } } Else { ; Saiが非アクティブなら Gosub, TenkeyMode } } Else If ( wParam = 2 ) { ; USBテンキー②なら Gosub, TenkeyMode } Else { ; 他USBデバイスなら Gosub, TenkeyMode } return TenkeyMode ; 通常のテンキーにする tenkeys = Numpad1|Numpad2|Numpad3|Numpad4|Numpad5|Numpad6|Numpad7|Numpad8|Numpad9|Numpad0 tenkeys = %tenkeys%|Numpaddot|Tab|NumpadDiv|NumpadMult|Bs|Numpadsub|Numpadadd|NumpadEnter Loop, Parse, tenkeys, | { If ( lParam = A_Index ) send, {%A_LoopField%} } return } このサンプルをDownloadする ファイル名やディレクトリがHID Macrosで設定したものと異なると動作(連携)しません。元ファイルを上書きコピーするか、中身だけを元の ahk_hidmacros.ahk にコピペして実行してください。 スクリプトファイルのファイルエンコーディングについてアップロードしているスクリプトサンプルは全てShift JIS形式で保存しています。そのままだとAutohotkey_L Unicode版(以後、L版)で動作しません。L版で利用するにはスクリプトサンプル(ahk_hidmacros.ahk)をテキストエディタ(NotePad等)で開き、 UTF-8 形式で保存(上書き保存)してから利用してください。参考サイト:テキストをUTF-8形式で保存する。
https://w.atwiki.jp/pincos081/pages/77.html
現在の目標 名前が示すように、現在のターゲットウィンドウは、 Target Currentを使用したすべてのアクションで使用される現在のターゲットを表します。 デフォルトでは、現在のターゲットには、あなたとターゲットの間の距離、ターゲットの健康状態、およびメインのコンテキスト メニューのアクションが表示されます。 多くのウィンドウと同様に、このウィンドウもロックすることができ、スケールとアルファ モードの影響を受けます。 すべてのターゲットには、現在のターゲットを閉じるための [X] ボタンもあります。 すべてのターゲットには自動ターゲット ボタンもあります。使用すると、自動ターゲット機能を切り替えることができます ( [現在の自動ターゲット]アクションを使用するのと同じです)。アクティブな場合、すべてのカーソル ターゲットは、激怒するとすぐに現在のターゲットに対して自動的に使用されます。
https://w.atwiki.jp/thvision/pages/220.html
《アクティブ》/用語・ルール用語} 定義 カードが起きている状態。 場及びノードに縦向きにセットされているカードを指す。 コメント この状態からスリープ状態にすることで、攻撃・防御をはじめとする様々な効果を使用できる。 ノードの場合はこの状態からスリープ状態にすることで1コストを支払える。 キャラクターカードが攻撃・防御宣言を行う為にはアクティブ状態である必要がある。 また【】という条件を持つテキストを使用する場合も そのカードがアクティブ状態である必要がある。これは世界呪符でも同様である。 (当wikiでは便宜上、(S)と表記されている。) スリープ状態のキャラクターと世界呪符は、自分のアクティブフェイズで自動的にアクティブ状態になる。 その際、ノードはアクティブに戻らないので注意しよう。 もちろん彩符『彩光乱舞』で得た追加のアクティブフェイズや、永夜の術で得た第2の自分ターンのアクティブフェイズでも同様である。 尚、木符『シルフィホルン』の様に、自らアクティブ状態になることが出来るカードも存在する。 奇術『ミスディレクション』や離反工作+解呪のコンボ等を使うことで、メインフェイズ中にアクティブ状態にすることも可能である。 関連 スリープ
https://w.atwiki.jp/medadictionary/pages/446.html
アクティブ 登場 3 4 navi 5 アクティブ 概要 アクティブに該当する行動一覧 概要 メダロット5までに存在した、特定の攻撃特性が持つ特性。 この特性を持つ攻撃特性は援護・構えのいずれかの部類に属し、それぞれ必要な状況に応じて効果を発揮する。 例 防御による援護を行ったあと、味方が攻撃対象になったとき庇いにいく 反射による構えをとっている間に攻撃を受けると、その攻撃を跳ね返す 基本的に防御系の行動が多く、味方への被害を最小限に抑えたりすることができる。 弱点は体勢破壊とダイレクト特性を持つ攻撃。 メダロットDSでの再始動以降アクティブ特性は廃止され、援護系行動と反射・反撃はガード体勢のわざ、スキルへと移行している。 アクティブに該当する行動一覧 援護に属するアクティブ行動 防御 未満防御 完全防御 火薬無効 使用して援護を行った場合のみ 光学無効 重力無効 構えに属するアクティブ行動 完全無効 反射 反撃 ダメージ減少 ターゲット吸収 加護
https://w.atwiki.jp/dgsummoner/pages/14.html
アクティブ No 【キャラ名】 性別 Rnk 攻撃 防御 体力 精神 能力名 能力内容 李祝花 女 C 16 5 9 0 心泰身寧是帰処 【アクティブ】通常攻撃ダメージを体力の代わりに精神に与える 糸子 女 SR 14 4 8 4 ピースフルサクリファイス 【アクティブ】敵召喚士含む、精神0の敵魔人全員即死 制約:自分戦線離脱 鳳まつば 女 C 16 0 5 7 孔雀色十三夜 【アクティブ】敵全員精神2ダメージ 制約:自分死亡 桂珪斬 男 UC 11 0 8 5 うしみつ 【アクティブ】男性一体を即死 制約:自分行動不能 木陰ムツキ 女 UC 12 7 6 3 偽刀・滅覚 【アクティブ】相手側の防御を精神力で計算して通常攻撃 山人の英雄ガヤリ 男 C 20 0 6 3 ガヤリの狩 【アクティブ】次ターン、ガヤリが二回行動可能 屍堂覚悟 男 C 17 4 5 3 菊門一文字 【アクティブ】敵魔人一人を1ターン行動不能 制約:1回のみ 白金無一人 男 R 13 5 6 6 秘剣・夢幻鏡面殺 【アクティブ】召喚士含む、精神0の敵一人を即死 白金光留 女 SR 17 4 4 4 秘剣・業火剣嵐 【アクティブ】敵全員に通常攻撃。火属性 制約:一度のみ スカラカーン 男 UC 20 0 5 5 魔人拳 【アクティブ】一瞬だけ攻撃+5で通常攻撃 制約:行動不能 壮絶なるイズミ 男 C 20 0 5 4 破獣の技 【アクティブ】敵男性魔人一体に精神10ダメージ+通常攻撃 制約:自分死亡 とりせつ 男 R 12 8 6 4 この指とまれ 【アクティブ】敵召喚士の手札全てをノーコストで敵側に召喚する ネクロマンス・ダンス 男 R 12 3 6 4 アナライズアイズ 【アクティブ】相手の手札を一度見る 服部風香 女 UC 14 0 5 4 忍法・心喰波 【アクティブ】精神0の敵全員に体力5ダメージ 鳩子 女 R 15 4 8 3 平和主義者の主張 【アクティブ】精神0の敵全員戦線離脱 制約:戦線離脱 日向空 女 C 12 5 4 3 科学木刀α版 【アクティブ】敵1体を1ターン行動不能 制約:一度のみ ぽぽ=アーネ 女 R 12 3 7 2 悲しみの魔人材派遣労働 【アクティブ】魔人を1体要コスト召喚する 制約:一度のみ ぽぽ=あJ 男 C 15 0 6 3 性転換V 【アクティブ】味方魔人全員の精神3アップ 制約:一度のみ ぽぽ=チョーナン 男 UC 18 2 4 4 アキカン地獄への扉 【アクティブ】攻撃力6で敵全員に通常攻撃 乱回堂 男 UC 15 0 4 4 チキンスレイヤー 【アクティブ】敵魔人一体に「相手の防御-相手の攻撃」分の体力ダメージ 制約:一度のみ バルバロッサ土田 男 UC 12 3 3 6 終焉の黙示 【アクティブ】攻撃0の敵1体を即死 制約:一度のみ ワシュー=レイダット 男 C 20 1 4 5 霧と老人 【アクティブ】通常攻撃後、自分が戦線離脱 白熊 男 UC 15 5 6 4 食事 【アクティブ】防御10アップ 制約:一度のみ/味方一人死亡 ラーモレック=モルドレッド 男 C 10 1 4 5 惨凶大革命 【アクティブ】攻撃0かつ防御0の敵魔人全員に通常攻撃 レーテ・マオアー 女 UC 13 2 11 4 ベルリンの赤い壁 【アクティブ】次ターン、相手側は召喚できない 制約:一度のみ No 【キャラ名】 性別 Rnk 攻撃 防御 体力 精神 能力名 能力内容 アッシュ 男 UC 5 15 5 5 詠唱失敗 【アクティブ】敵魔人全員のアクティブ能力発動。対象指定が必要なものは発動しない。制約:自分戦線離脱 アイーナ 女 C 0 10 6 7 星の知恵派の教え 【アクティブ】敵味方区別なく全員に精神2ダメージ MCヒロシ 男 SR 0 17 7 3 リリカルマダラーRIP 【アクティブ】敵魔人全員即死 制約:最終ターンのみ かがみ 男 C 0 10 9 5 ゆとり感化ガス 【アクティブ】敵魔人全員精神2ダメージ 鬼無瀬 雷観 男 UC 0 12 7 3 鬼無瀬時限流中目録「四囲敷応」 【アクティブ】次ターンの鬼無瀬の行動は敵味方全員に体力4ダメージとなる 小泉ヒズミ 男 SR 5 15 7 3 小泉 Go with me 【アクティブ】自分の攻撃と防御を一瞬入れ替えて通常攻撃 小竹アキカン 男 C 1 9 9 3 ガス漏れ・改 【アクティブ】敵味方全員、精神4ダメージ 制約:自分戦線離脱 コバヤシ 男 UC 0 15 8 4 パラノイアック・プロジェクション 【アクティブ】敵全員、精神3ダメージ 制約:自分行動不能 スライム-SR92 なし C 0 10 20 0 放送禁止空間限定作成 【アクティブ】敵味方女性魔人全員の精神3ダメージ 玉藻 女 UC 10 10 7 3 爆妖力 【アクティブ】攻撃力倍で通常攻撃 制約:行動不能 ハイジ 女 C 0 6 9 5 みんなにもきれいなお花をあげる 【アクティブ】次のフェイズ、敵は通常攻撃ができない 制約:戦線離脱 出鯉舞 女 R 0 14 12 4 ダイナマイト・ドレス 【アクティブ】敵魔人全員と自分に体力3ダメージ。火属性 堂島 焦香 女 C 0 11 7 4 とりあえずビーム 【アクティブ】敵魔人1体に「4-自分の精神力」の体力ダメージ バル 男 C 0 10 10 10 裏切り 【アクティブ】味方魔人を全員殺し、即座に相手側の魔人となる(相手側のノーコスト召喚扱い) 範馬マキ 女 R 0 10 10 4 霊切丸 【アクティブ】敵一体を即死 制約:自分死亡 フジクロ 男 UC 0 13 10 4 八咫鴉 【アクティブ】精神0の敵全員に体力3ダメージ フジミズ 女 C 0 8 8 4 飴・花火 【アクティブ】精神0の敵1体を即死、召喚士の精神減少が倍に 巳桜紫苑 女 C 1 10 12 7 ヒトクイ 【アクティブ】精神0の敵一体を即死。以降、紫苑はそのキャラの能力を得る。 メカ 男 C 5 20 2 3 装備による能力上昇 【アクティブ】攻撃力を3アップ 制約:一度のみ 森園モリオ 男 UC 0 20 4 4 エターナル読書 【アクティブ】敵全員体力2ダメージ 制約:行動不能 歪み崎絶子 女 C 0 13 8 5 ユガミ時空 【アクティブ】召喚士含め敵味方任意一体の防御と精神を入れ替える 制約:一度のみ 待宵桃 女 C 14 0 8 6 七つの子 【アクティブ】敵全員に精神3ダメージ 翼姫 女 C 0 13 8 4 天帝少女 【アクティブ】味方魔人一人を次ターン2回行動させる。制約:一度のみ リマインド・ハット 女 C 0 7 10 5 サイコ・コロネード 【アクティブ】精神0の敵魔人全員を1ターン行動不能にする 制約:一度のみ ロケット土田 男 UC 0 10 6 8 亜空断裂式万能包丁・わかば小町 【アクティブ】敵一体を戦線離脱 制約:行動不能 チューリッヒ・ローザンヌ 女 UC 0 18 7 4 エターナルニュートラリティー 【アクティブ】攻撃と防御を一瞬入れ替えて通常攻撃 制約:戦線離脱 あっちんちん 男 UC 10 9 5 6 召喚 【アクティブ】山札から一枚ランダムで引いて味方として要コスト召喚 制約:一度のみ 怨み崎Death子 女 UC 11 9 7 3 自殺ブリミナル 【アクティブ】敵召喚士に体力2ダメージ S崎さん 女 UC 0 0 14 6 働け!働け!! 【アクティブ】召喚士含む任意一人を再行動させる。自分は選べない 制約:一度のみ 榎本 繁冶 男 SR 0 0 10 10 帰ってきたデビルシザーズ 【アクティブ】相手魔人全員即死。 制約:自発的に召喚できない 木戸すたる 男 C 8 4 10 8 月に願いを 【アクティブ】次ターン、敵魔人全員に精神3ダメージ 鏡子 女 SR 0 0 8 2 ぴちぴちビッチ 【アクティブ】召喚士含む任意一体に精神4ダメージ シスターX 女 SR 0 0 6 4 X毒電波 【アクティブ】召喚士含む味方全員を再行動させる。自分は含まない 制約:一度のみ 城杏奈 女 UC 3 2 10 4 予言? 【アクティブ】召喚士含む精神0の敵1体を直ちに操作 次郎丸弘美 女 UC 0 7 9 4 BSDN 【アクティブ】防御0の敵女性魔人は全員即死 仁朗太 男 R 0 0 10 0 米やろう 【アクティブ】味方魔人一人の防御を無限にする。 制約:自分死亡 すごい男 男 C 0 0 13 7 超惑星十字配置 【アクティブ】味方魔人が全員戦線離脱 園部香夏子 女 SR 0 0 15 5 中二神のご加護 【アクティブ】敵味方区別なく、場、および墓場の魔人1体の能力を使用できる 制約:一度のみ 多木須賀 シキノ 女 UC 0 5 8 4 シキノの世界 【アクティブ】召喚士含む、精神0の敵魔人全員に3ダメージ 中村仁 男 R 7 4 4 3 無我の境地・改 【アクティブ】敵味方問わず、それまでに発動された能力を任意で1つ発動できる バッド・F・ワーカー 男 R 9 5 4 5 嫌な花火 【アクティブ】敵味方の墓場にいるキャラの合計数、敵味方全員に体力ダメージ。火属性 細川ガラシャ 女 C 7 0 7 5 細川踏み絵 【アクティブ】召喚中の味方魔人1体を敵陣の魔人として召喚しなおす 豆 女 C 0 0 2 3 寝返り 【アクティブ】敵に寝返る(ノーコスト召喚扱い) 三田康成 男 SR 0 3 3 4 敵召喚 【アクティブ】敵召喚士の手札を見て、1枚を敵陣に召喚させる。召喚コストは相手が支払う。 無桐 箪笥 男 SR 0 0 5 5 世界の合言葉は森 【アクティブ】召喚士含め、敵魔人全員が毎ターン体力2ダメージ。 制約:自分と味方一人行動不能/どちらかが死ぬと解除/一回のみ チャーシューマン 男 UC 5 7 7 5 奥義・火噴掌 【アクティブ】敵魔人一体に体力4ダメージ、もしくは、敵召喚士に体力2ダメージ。火属性 制約:一度のみ 弥十郎 男 C 0 0 12 0 零距離射撃 【アクティブ】敵魔人一体に体力5ダメージ 制約:一度のみ 木下鏡介 男 転 20 15 10 10 空間歪曲 【アクティブ】相手の手札一枚をランダムで選び、通常攻撃。撃破時は死亡扱いとし墓場へ送る。 龍閃獅殺 男 転 20 5 17 7 アルティメットインフィニティサンデイ 【アクティブ】防御15以上の敵一体を戦線離脱 南崎シンリ 女 転 20 12 15 10 セーラー服と機関銃 【アクティブ】精神0の敵全員に体力3ダメージ
https://w.atwiki.jp/freememo/pages/44.html
ウィンドウの種類ウィンドウ モーダルダイアログ モードレスダイアログ ウィンドウの状態有効/無効 表示/非表示 最小化(アイコン化)/最大化(全画面表示) トップモースト ウィンドウの階層デスクトップウィンドウ トップレベルウィンドウ 子ウィンドウ 親ウィンドウ 兄弟ウィンドウ オーナーウィンドウ ウィンドウを半透明にする。 コメント ウィンドウの種類 ウィンドウ 最も良く使われる汎用的ウィンドウ。 モーダルダイアログ 一度開いたダイアログボックス(画面)を閉じるまで、 アプリ内の他の操作をできなくするダイアログボックス。 モードレスダイアログ モーダルダイアログと異なり、一度開いたダイアログボックスを閉じなくても、 アプリ内の他の操作ができるダイアログボックス。 TOP ウィンドウの状態 有効/無効 有効な場合、キー入力・マウス入力を受け付け、無効な場合、キー入力・マウス入力を受け付けない。 表示/非表示 非表示の場合、ウィンドウ(コントロール)は表示されない。 最小化(アイコン化)/最大化(全画面表示) 最小化の場合、タスクバーに表示され、最大化の場合、全画面表示される。 トップモースト 通常のウィンドウより、常に前面に表示される。 TOP ウィンドウの階層 デスクトップウィンドウ そのまま。 トップレベルウィンドウ デスクトップ上に配置されているウィンドウ。通常、タスクバーに表示される。 子ウィンドウ あるウィンドウ上に配置されているウィンドウ。 親ウィンドウ 子ウィンドウが配置されているウィンドウ。 兄弟ウィンドウ 同じ親ウィンドウを持つ子ウィンドウ。 オーナーウィンドウ ウィンドウの所有者(=ウィンドウ)。所有されたウィンドウは、所有者の前面に表示される。 TOP ウィンドウを半透明にする。 対象となるウィンドウハンドルを取得して、以下のソースを実装する。 DWORD dwStyle = GetWindowLong(m_hWnd, GWL_EXSTYLE); SetWindowLong(m_hWnd, GWL_EXSTYLE, dwStyle | WS_EX_LAYERED); int nAlpha = 0x7f; SetLayeredWindowAttributes(m_hWnd, 0, (BYTE)nAlpha, LWA_ALPHA); TOP コメント 名前 コメント TOP
https://w.atwiki.jp/yanya/pages/17.html
ハンドルにUSBテンキーを固定する PS3コントローラーとUSBテンキーを固定するために髪留め用のゴムを付けています。 ダイソーで長さ50~60cmのゴム2本で105円でした。 Lanケーブルの端子はUSBテンキーを接続するためのものです(ハンドルの中心にケーブルを通している)。 アイスの棒をカットしたものがハンドル中心の上に2つ、下の方に積み重ねたものが写っていますが、これはUSBテンキーを載せるための台座です。 使用しているUSBテンキーは近所の家電量販店で縦幅が一番小さく、薄型だったのでTK-TCP006にしました。 PC用レースゲーム時はUSBテンキーをこのように固定して使っています。 脱着可能です。 ものすごく便利です。 2の下は00キーなのですが誤って押すことがあるためキーを外し、解りにくいですが周りを円柱状のもので囲っています。 キーカスタマイズはAutohotkey(日本語解説も充実しています)で行なっていますがCodeMasters系のゲームはウィンドウがアクティブになる度にキーフックしてくるようなのでautohotkeyでカスタマイズしたものが無効化されます。回避方法としてはCodeMasters系ゲームウィンドウがアクティブになったらAhkスクリプトをReloadさせれば(スクリプト中にゲームウィンドウがアクティブになったらReloadするように記述しておくと)効くようになります。また、非連動型タイプのテンキーを使う場合はキーボード(Windows上)とUSBテンキーのNumlock状態を同じにしておいてください。Numlock状態を同じ(On、Offのどちらか一方の状態に固定する)にしておかないとUSBテンキーのキーを押す度にNumlockキーが発行されて正常に動作してくれない場合があります。 autohotkeyの使い方が面倒という方はHidKeySequenceがオススメです。HidKeySequenceはデバイスごとにキーカスタマイズが可能なのでテンキーを複数接続してもそれぞれ独立した設定にすることが出来る便利なツールです。 テンキーが縦に長すぎる感じがしたのでぶった切っています! テンキーの裏側ですがゴムを引っ掛けるために大きめのゼムクリップを通しています。 いろんなところに穴が開いてたりして試行錯誤の後がハッキリと分かりますw このようにゴムを引っ掛けています。 テンキーのUSBケーブル(通常5線)を脱着するためにLanケーブルを流用したのですが、このテンキーは4線だったので電話線用の6極4芯でもよかったです。 ぶった切ったところを塞ぐために養生テープを使ってます。 開けるときにベタつかずに外せるのが良いです。 ぶった切ったところはこのようになっています。
https://w.atwiki.jp/autohotkey_v2/pages/18.html
Table of Contents Introduction and Simple Examples Ending Characters Options Long Replacements Context-sensitive Hotstrings AutoCorrect Remarks Named Function Hotstrings Hotstring Helper Introduction and Simple Examples Although hotstrings are mainly used to expand abbreviations as you type them (auto-replace), they can also be used to launch any scripted action. In this respect, they are similar to hotkeys except that they are typically composed of more than one character (that is, a string). To define a hotstring, enclose the triggering abbreviation between pairs of colons as in this example btw by the way In the above example, the abbreviation btw will be automatically replaced with "by the way" whenever you type it (however, by default you must type an ending character after typing btw, such as Space, ., or Enter). The "by the way" example above is known as an auto-replace hotstring because the typed text is automatically erased and replaced by the string specified after the second pair of colons. By contrast, a hotstring may also be defined to perform any custom action as in the following examples. Note that the functions must appear beneath the hotstring btw { MsgBox You typed "btw". } * ]d ; This hotstring replaces "]d" with the current date and time via the functions below. { SendInput FormatTime(, "M/d/yyyy h mm tt") ; It will look like 9/1/2005 3 53 PM } In the above, the braces serve to define a function body for each hotstring. The opening brace may also be specified on the same line as the double-colon to support the OTB (One True Brace) style. Even though the two examples above are not auto-replace hotstrings, the abbreviation you type is erased by default. This is done via automatic backspacing, which can be disabled via the b0 option. When a hotstring is triggered, the name of the hotstring is passed as its first parameter named ThisHotkey (which excludes the trailing colons). For example X btw MsgBox ThisHotkey ; Reports X btw With few exceptions, this is similar to the built-in variable A_ThisHotkey. The parameter name can be changed by using a named function. Ending Characters Unless the asterisk option is in effect, you must type an ending character after a hotstring s abbreviation to trigger it. Ending characters initially consist of the following -()[]{} ;"/\,.?!nt (note that n is Enter,t is Tab, and there is a plain space between n andt). This set of characters can be changed by editing the following example, which sets the new ending characters for all hotstrings, not just the ones beneath it Hotstring EndChars -()[]{} ; "/\,.?!nt The ending characters can be changed while the script is running by calling the Hotstring function as demonstrated below Hotstring("EndChars", "-()[]{} ;") Options A hotstring s default behavior can be changed in two possible ways The #Hotstring directive, which affects all hotstrings physically beneath that point in the script. The following example puts the C and R options into effect #Hotstring c r. Putting options inside a hotstring s first pair of colons. The following example puts the C and options (case sensitive and "ending character not required") into effect for a single hotstring c j@ john@somedomain.com. The list below describes each option. When specifying more than one option using the methods above, spaces optionally may be included between them. (asterisk) An ending character (e.g. Space, ., or Enter) is not required to trigger the hotstring. For example j@ jsmith@somedomain.com The example above would send its replacement the moment you type the @ character. When using the #Hotstring directive, use 0 to turn this option back off. ? (question mark) The hotstring will be triggered even when it is inside another word; that is, when the character typed immediately before it is alphanumeric. For example, if ? al airline is a hotstring, typing "practical " would produce "practicairline ". Use ?0 to turn this option back off. B0 (B followed by a zero) Automatic backspacing is not done to erase the abbreviation you type. Use a plain B to turn backspacing back on after it was previously turned off. A script may also do its own backspacing via {bs 5}, which sends Backspace five times. Similarly, it may send ← five times via {left 5}. For example, the following hotstring produces "" and moves the caret 5 places to the left (so that it s between the tags) *b0 {left 5} C Case sensitive When you type an abbreviation, it must exactly match the case defined in the script. Use C0 to turn case sensitivity back off. C1 Do not conform to typed case. Use this option to make auto-replace hotstrings case insensitive and prevent them from conforming to the case of the characters you actually type. Case-conforming hotstrings (which are the default) produce their replacement text in all caps if you type the abbreviation in all caps. If you type the first letter in caps, the first letter of the replacement will also be capitalized (if it is a letter). If you type the case in any other way, the replacement is sent exactly as defined. When using the #Hotstring directive, C0 can be used to turn this option back off, which makes hotstrings conform again. Kn Key-delay This rarely-used option sets the delay between keystrokes produced by auto-backspacing or auto-replacement. Specify the new delay for n; for example, specify k10 to have a 10ms delay and k-1 to have no delay. The exact behavior of this option depends on which sending mode is in effect SI (SendInput) Key-delay is ignored because a delay is not possible in this mode. The exception to this is when SendInput is unavailable, in which case hotstrings revert to SendPlay mode below (which does obey key-delay). SP (SendPlay) A delay of length zero is the default, which for SendPlay is the same as -1 (no delay). In this mode, the delay is actually a PressDuration rather than a delay between keystrokes. SE (SendEvent) A delay of length zero is the default. Zero is recommended for most purposes since it is fast but still cooperates well with other processes (due to internally doing a Sleep 0). Specify k-1 to have no delay at all, which is useful to make auto-replacements faster if your CPU is frequently under heavy load. When set to -1, a script s process-priority becomes an important factor in how fast it can send keystrokes. To raise a script s priority, use ProcessSetPriority "High". O Omit the ending character of auto-replace hotstrings when the replacement is produced. This is useful when you want a hotstring to be kept unambiguous by still requiring an ending character, but don t actually want the ending character to be shown on the screen. For example, if o ar aristocrat is a hotstring, typing "ar" followed by the spacebar will produce "aristocrat" with no trailing space, which allows you to make the word plural or possessive without having to press Backspace. Use O0 (the letter O followed by a zero) to turn this option back off. Pn The priority of the hotstring (e.g. P1). This rarely-used option has no effect on auto-replace hotstrings. R Send the replacement text raw; that is, without translating {Enter} to Enter, ^c to Ctrl+C, etc. Use R0 to turn this option back off, or override it with T. Note Text mode may be more reliable. The R and T options are mutually exclusive. S or S0 Specify the letter S to make the hotstring exempt from Suspend. Specify S0 (S with the number 0) to remove the exemption, allowing the hotstring to be suspended. When applied as a default option, either S or #SuspendExempt will make the hotstring exempt; that is, to override the directive, S0 must be used explicitly in the hotstring. SI or SP or SE Sets the method by which auto-replace hotstrings send their keystrokes. These options are mutually exclusive only one can be in effect at a time. The following describes each option SI stands for SendInput, which typically has superior speed and reliability than the other modes. Another benefit is that like SendPlay below, SendInput postpones anything you type during a hotstring s auto-replacement text. This prevents your keystrokes from being interspersed with those of the replacement. When SendInput is unavailable, hotstrings automatically use SendPlay instead. SP stands for SendPlay, which may allow hotstrings to work in a broader variety of games. SE stands for SendEvent. If none of the above options are used, the default mode is SendInput. However, unlike the SI option, SendEvent is used instead of SendPlay when SendInput is unavailable. T Send the replacement text using Text mode. That is, send each character by character code, without translating {Enter} to Enter, ^c to Ctrl+C, etc. and without translating each character to a keystroke. This option is put into effect automatically for hotstrings that have a continuation section. Use T0 or R0 to turn this option back off, or override it with R. X Execute. Instead of replacement text, the hotstring accepts a function call or expression to execute. For example, X ~mb MsgBox would cause a message box to be displayed when the user types "~mb" instead of auto-replacing it with the word "MsgBox". This is most useful when defining a large number of hotstrings which call functions, as it would otherwise require three lines per hotstring. This option should not be used with the Hotstring function. To make a hotstring call a function when triggered, pass the function by reference. Z This rarely-used option resets the hotstring recognizer after each triggering of the hotstring. In other words, the script will begin waiting for an entirely new hotstring, eliminating from consideration anything you previously typed. This can prevent unwanted triggerings of hotstrings. To illustrate, consider the following hotstring b0*? 11 { SendInput "xx" } Since the above lacks the Z option, typing 111 (three consecutive 1 s) would trigger the hotstring twice because the middle 1 is the last character of the first triggering but also the first character of the second triggering. By adding the letter Z in front of b0, you would have to type four 1 s instead of three to trigger the hotstring twice. Use Z0 to turn this option back off. Long Replacements Hotstrings that produce a large amount of replacement text can be made more readable and maintainable by using a continuation section. For example text1 ( Any text between the top and bottom parentheses is treated literally. By default, the hard carriage return (Enter) between the previous line and this one is also preserved. By default, the indentation (tab) to the left of this line is preserved. ) See continuation section for how to change these default behaviors. The presence of a continuation section also causes the hotstring to default to Text mode. The only way to override this special default is to specify an opposing option in each hotstring that has a continuation section (e.g. t0 text1 or r text2 ). Context-sensitive Hotstrings The #HotIf directive can be used to make selected hotstrings context sensitive. Such hotstrings send a different replacement, perform a different action, or do nothing at all depending on any condition, such as the type of window that is active. For example HotIf WinActive("ahk_class Notepad") btw This replacement text will appear only in Notepad. HotIf btw This replacement text appears in windows other than Notepad. AutoCorrect The following script uses hotstrings to correct about 4700 common English misspellings on-the-fly. It also includes a Win+H hotkey to make it easy to add more misspellings Download AutoCorrect.ahk (127 KB) Author Jim Biancolo and Wikipedia s Lists of Common Misspellings Remarks Expressions are not currently supported within the replacement text. To work around this, don t make such hotstrings auto-replace. Instead, use the SendInput function beneath the abbreviation, followed by a line containing only the word Return. To send an extra space or tab after a replacement, include the space or tab at the end of the replacement but make the last character an accent/backtick (`). For example btw By the way ` For an auto-replace hotstring which doesn t use the Text or Raw mode, sending a { alone, or one preceded only by white-space, requires it being enclosed in a pair of brackets, for example brace {{} and * space_brace {{}. Otherwise it is interpreted as the opening brace for the hotstring s function to support the OTB (One True Brace) style. By default, any click of the left or right mouse button will reset the hotstring recognizer. In other words, the script will begin waiting for an entirely new hotstring, eliminating from consideration anything you previously typed (if this is undesirable, specify the line #Hotstring NoMouse anywhere in the script). This "reset upon mouse click" behavior is the default because each click typically moves the text insertion point (caret) or sets keyboard focus to a new control/field. In such cases, it is usually desirable to 1) fire a hotstring even if it lacks the question mark option; 2) prevent a firing when something you type after clicking the mouse accidentally forms a valid abbreviation with what you typed before. The hotstring recognizer checks the active window each time a character is typed, and resets if a different window is active than before. If the active window changes but reverts before any characters are typed, the change is not detected (but the hotstring recognizer may be reset for some other reason). The hotstring recognizer can also be reset by calling Hotstring "Reset". The built-in variable A_EndChar contains the ending character that you typed to trigger the most recent non-auto-replace hotstring. If no ending character was required (due to the * option), it will be blank. A_EndChar is useful when making hotstrings that use the Send function or whose behavior should vary depending on which ending character you typed. To send the ending character itself, use SendText A_EndChar (SendText is used because characters such as !{} would not be sent correctly by the normal Send function). Although single-colons within hotstring definitions do not need to be escaped unless they precede the double-colon delimiter, backticks and those semicolons having a space or tab to their left must always be escaped. See Escape Sequences for a complete list. Although the Send function s special characters such as {Enter} are supported in auto-replacement text (unless the raw option is used), the hotstring abbreviations themselves do not use this. Instead, specify n for Enter andt (or a literal tab) for Tab (see Escape Sequences for a complete list). For example, the hotstring * ab`t would be triggered when you type "ab" followed by a tab. Spaces and tabs are treated literally within hotstring definitions. For example, the following would produce two different results btw by the way and btw by the way. Each hotstring abbreviation can be no more than 40 characters long. The program will warn you if this length is exceeded. By contrast, the length of hotstring s replacement text is limited to about 5000 characters when the sending mode is at its default of SendInput. That limit can be removed by switching to one of the other sending modes, or by using SendPlay or SendEvent in the body of the hotstring. The order in which hotstrings are defined determines their precedence with respect to each other. In other words, if more than one hotstring matches something you type, only the one listed first in the script will take effect. Related topic context-sensitive hotstrings. Any backspacing you do is taken into account for the purpose of detecting hotstrings. However, the use of ↑, →, ↓, ←, PgUp, PgDn, Home, and End to navigate within an editor will cause the hotstring recognition process to reset. In other words, it will begin waiting for an entirely new hotstring. A hotstring may be typed even when the active window is ignoring your keystrokes. In other words, the hotstring will still fire even though the triggering abbreviation is never visible. In addition, you may still press Backspace to undo the most recently typed keystroke (even though you can t see the effect). A hotstring s function can be called explicitly by the script only if the function has been named. See Named Function Hotstrings. Hotstrings are not monitored and will not be triggered while input is blocked by an invisible Input hook. By default, hotstrings are never triggered by keystrokes produced by any AutoHotkey script. This avoids the possibility of an infinite loop where hotstrings trigger each other over and over. This behaviour can be controlled with #InputLevel and SendLevel. However, auto-replace hotstrings always use send level 0 and therefore never trigger hook hotkeys or hotstrings. Hotstrings can be created dynamically by means of the Hotstring function, which can also modify, disable, or enable the script s existing hotstrings individually. The InputHook function is more flexible than hotstrings for certain purposes. For example, it allows your keystrokes to be invisible in the active window (such as a game). It also supports non-character ending keys such as Esc. The keyboard hook is automatically used by any script that contains hotstrings. Hotstrings behave identically to hotkeys in the following ways They are affected by the Suspend function. They obey #MaxThreads and #MaxThreadsPerHotkey (but not #MaxThreadsBuffer). Scripts containing hotstrings are automatically persistent. Non-auto-replace hotstrings will create a new thread when launched. In addition, they will update the built-in hotkey variables such as A_ThisHotkey. Known limitation On some systems in Java applications, hotstrings might interfere with the user s ability to type diacritical letters (via dead keys). To work around this, Suspend can be turned on temporarily (which disables all hotstrings). Named Function Hotstrings If the function of a hotstring is ever needed to be called without triggering the hotstring itself, one or more hotstrings can be assigned a named function by simply defining it immediately after the hotstring s double-colon, as in this example ; This example also demonstrates one way to implement case conformity in a script. C BTW ; Typed in all-caps. C Btw ; Typed with only the first letter upper-case. btw ; Typed in any other combination. case_conform_btw(hs) ; hs will hold the name of the hotstring which triggered the function. { if (hs == " C BTW") Send "BY THE WAY" else if (hs == " C Btw") Send "By the way" else Send "by the way" } If the function case_conform_btw is ever called explicitly by the script, the first parameter (hs) must be passed a value. Hotkeys can also be defined this way. Multiple hotkeys or hotstrings can be stacked together to call the same function. There must only be whitespace or comments between the hotstring and the function name. Naming the function also encourages self-documenting hotstrings, like in the code above where the function name describes the hotstring. The Hotstring function can also be used to assign a function or function object to a hotstring. Hotstring Helper Take a look at the first example in the example section of the Hotstring function s page, which might be useful if you are a heavy user of hotstrings. By pressing Win+H (or another hotkey of your choice), the currently selected text can be turned into a hotstring. For example, if you have "by the way" selected in a word processor, pressing Win+H will prompt you for its abbreviation (e.g. btw), add the new hotstring to the script and activate it.